-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add metric for message processing latency #1956
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note this Middleware is only added to the executor. If you want to capture general message processing, you should add this to the eventer itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A Histogram may be more useful in the future, if we end up with an implementation which can handle multiple in-flight events at once (i.e. out-of-order execution). I almost thought about asking for one, then decided it was overkill. 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's discuss where this shows go first. I think it should be in the eventer instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, meant to request changes.
I'd be comfortable with a Middleware. I'm also wondering whether we should contribute to https://github.com/ThreeDotsLabs/watermill/blob/master/components/metrics/handler.go#L62 rather than adding our own additional Middleware. |
Actually, we might want to hook |
I filed ThreeDotsLabs/watermill#417 to see if this would be accepted upstream. In the meantime, it feels like it would make sense to implement this as a Middleware / PublisherDecorator in |
fd1c2bd
to
6506d63
Compare
@JAORMX @evankanderson I moved the code into the eventer. |
6506d63
to
a812bd6
Compare
a812bd6
to
061fa4c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shipit 🚢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops, the unit test issue seems legit
@JAORMX On it. |
061fa4c
to
14286e5
Compare
Fix #1839
Opted for a histogram instead of gauge, because the library doesn't have a synchronous gauge.